import time

import allure
from page_object.page_roncoo_pay_login import PageLogin
from page_element.el_Roncoo import *
import logging



class BindBandCard(PageLogin):
    """添加用户支付配置"""

    def page_add_bind_bank_card(self, name,num,id_no,phone,address):
        # 前置条件：已登录
        # self.page_login('admin', '123456')
        with allure.step("点击支付管理"):
            self.click(payconfig_manage2.pay_manage)
        with allure.step("点击用户支付配置"):
            self.click(payconfig_manage2.user_pay_config)
        with allure.step("点击绑定银行卡"):
            self.click(payconfig_manage2.bind_bank_card)
        with allure.step("输入银行开户名"):
            self.send_keys(payconfig_manage2.bank_account_name,name)
        with allure.step("输入银行账号"):
            self.send_keys(payconfig_manage2.bank_number_inp,num)
        with allure.step("输入证件号码"):
            self.send_keys(payconfig_manage2.id_no_inp,id_no)
        with allure.step("输入手机号"):
            self.send_keys(payconfig_manage2.phone_inp,phone)
        with allure.step("输入详细地址"):
            self.send_keys(payconfig_manage2.address_inp,address)
        with allure.step("点击提交"):
            self.click(payconfig_manage2.tj_btn)


        # # 断言
        # with allure.step("验证新增的用户名"):
        #     dy = self.text(payconfig_manage.dy_payconfig_username_text)
        #     assert '刘北' in dy, '断言失败(添加用户失败)'
        #     print(f'断言的内容:刘北-在-{dy}')
        #     logging.info(f'断言的内容:刘北-在-{dy}')





